import request from '@/utils/request'

// let baseUrl = "http://10.168.1.213:8064";
// let baseUrl = 'http://localhost:8080'
// let baseUrl = 'http://10.168.1.123:8064'   //测试环境
// let baseUrl = 'http://10.168.1.222:8064'
let baseUrl = ''

// 上下调投入分类
export function adjustRegulationList(data) {
  return request({
    url: baseUrl + '/freq/dict/adjustRegulationList',
    method: 'post',
    data: data || {},
  })
}
//   操作类型
export function operateList(data) {
  return request({
    url: baseUrl + '/freq/dict/operateList',
    method: 'post',
    data: data || {},
  })
}
//   调度列表
export function regulationOrgList(data) {
  return request({
    url: baseUrl + '/freq/dict/regulationOrgList',
    method: 'post',
    data: data || {},
  })
}
//   厂站类型
export function stationTypeList(data) {
  return request({
    url: baseUrl + '/freq/dict/stationTypeList',
    method: 'post',
    data: data || {},
  })
}
//   电压等级
export function voltageLevelList(data) {
  return request({
    url: baseUrl + '/freq/dict/voltageLevelList',
    method: 'post',
    data: data || {},
  })
}
//   业主单位
export function queryOwnersList(data) {
  return request({
    url: baseUrl + '/freq/ownersInfo/queryOwnersList',
    method: 'post',
    data: data || {},
  })
}
//   试验单位
export function queryTestingUnitList(data) {
  return request({
    url: baseUrl + '/freq/testingUnitInfo/queryTestingUnitList',
    method: 'post',
    data: data || {},
  })
}
//   厂站名称、电厂名称
export function queryStationList(data) {
  return request({
    url:
      baseUrl +
      '/freq/unitsInfo/queryStationList?regulationOrgId=' +
      data.regulationOrgId +
      '&&stationType=' +
      data.stationType +
      '&&ownersId=' +
      data.ownersId,
    method: 'get',
  })
}

// 新增厂站字典
export function getInsertStationInfo(data) {
  return request({
    url: baseUrl + '/freq/unitsInfo/insertStationInfo',
    method: 'post',
    data: data || {},
  })
}
// 新增试验单位字典
export function getInsertTestingUnitInfo(data) {
  return request({
    url: baseUrl + '/freq/testingUnitInfo/insertTestingUnitInfo',
    method: 'post',
    data: data || {},
  })
}
// 新增业主单位字典
export function getInsertOwnersInfo(data) {
  return request({
    url: baseUrl + '/freq/ownersInfo/insertOwnersInfo',
    method: 'post',
    data: data || {},
  })
}

// 业主单位已存在查询
export function checkInsertOwnerName(data) {
  return request({
    url: baseUrl + '/freq/ownersInfo/checkInsertOwnerName',
    method: 'post',
    data: data || {},
  })
}

// 查询控股单位
export function queryCompanyList(data) {
  return request({
    url: baseUrl + '/freq/companyInfo/queryCompanyList',
    method: 'post',
    data: data || {},
  })
}

// 新增控股单位
export function getCompanyList(data) {
  return request({
    url: baseUrl + '/freq/companyInfo/insertCompanyInfo',
    method: 'post',
    data: data || {},
  })
}

// 常规场站类型
export function stationTypeLists(data) {
  return request({
    url: baseUrl + '/freq/dict/commonStationTypeList',
    method: 'post',
    data: data || {},
  })
}

// 删除业主单位
export function deleteOwnersInfo(data) {
  return request({
    url: baseUrl + '/freq/ownersInfo/deleteOwnersInfo',
    method: 'post',
    data: data || {},
  })
}

// 删除控股单位
export function deleteCompanyInfo(data) {
  return request({
    url: baseUrl + '/freq/companyInfo/deleteCompanyInfo',
    method: 'post',
    data: data || {},
  })
}

// 删除试验单位
export function deleteTestingUnitInfo(data) {
  return request({
    url: baseUrl + '/freq/testingUnitInfo/deleteTestingUnitInfo',
    method: 'post',
    data: data || {},
  })
}

export function agcControlList(data) {
  return request({
    url: baseUrl + '/freq/dict/agcControlList',
    method: 'post',
    data: data || {},
  })
}

// 登录接口
export function login(data) {
  return request({
    url: baseUrl + '/admin/freq/login',
    method: 'post',
    data: data || {},
  })
}

// 机组名称字典
export function queryUnitsNameList(data) {
  return request({
    url: baseUrl + '/freq/dict/queryUnitsNameList',
    method: 'post',
    data: data || {},
  })
}

// 场站名称字典
export function queryStationNameList(data) {
  return request({
    url: baseUrl + '/freq/dict/queryStationNameList',
    method: 'post',
    data: data || {},
  })
}


export function queryInfo(data) {
  // return Promise.resolve({
  //   code: '000000',
  //   mesg: '处理成功',
  //   time: '2024-02-23T00:52:25.272Z',
  //   data: [
  //     {
  //       regulationOrgId: "4",
  //       regulationOrgName: "云南",
  //       voltageLevelName: "110kV",
  //       voltageLevelCode: "110",
  //       ownersId: "1700027798081355853",
  //       ownersName: "马龙云能投新能源开发有限公司",
  //       isProduction: "1",
  //       testingUnitName: 'string',
  //       createUser: 'string',
  //       createTime: '2023-08-28T06:48:08',
  //       updateUser: 'string',
  //       updateTime: '2023-08-28T06:48:08',
  //     },
  //   ],
  // })
  return request({
    url:  baseUrl + "/freq/stationInfo/queryStationDetails",
    method: "post",
    data:data || {}
  });
}

// 获取场站的树型数据机构
export function queryOfExperimentalresults(data) {
  return request({
    url: baseUrl + "/freq/stationInfo/queryOfExperimentalresults",
    method: "post",
    data: data || {},
  });
}


//查询审核通过的文件
export function queryStationAuditedFiles(data) {
  return request({
    url: baseUrl + "/freq/dict/queryStationAuditedFiles",
    method: "post",
    data: data || {},
  });
}


//编辑电厂文件-测试方案/结果  弹窗提醒
export function updateStationFileWarn(data) {
  return request({
    url: baseUrl + "/freq/stationInfo/updateStationFileWarn",
    method: "post",
    data: data || {},
  });
}

// 试验单位重复校验
export function checkInsertTestUnitName(data) {
  return request({
    url: baseUrl + "/freq/testingUnitInfo/checkInsertTestUnitName",
    method: "post",
    data: data || {},
  });
}



